package com.yx.louti.authCode.controller;

import com.yx.louti.annotation.HttpResponseResult;
import com.yx.louti.annotation.NoLogin;
import com.yx.louti.authCode.model.ImgAuthCode;
import com.yx.louti.authCode.service.AuthCodeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 图形验证码,短信验证码
 */
@Api(tags = "图形验证码,短信验证码")
@RestController
@RequestMapping("/authCode")
@HttpResponseResult
public class AuthCodeController {

    @Autowired
    AuthCodeService authCodeService;

    @ApiOperation("获取图形验证码")
    @GetMapping("/imgAuthCode")
    @NoLogin
    public ImgAuthCode getImgAuthCode() {
        ImgAuthCode imgAuthCode = authCodeService.createImgAuthCode();
        imgAuthCode.setCode("****");
        return imgAuthCode;
    }


}
